package com.example.eurekaconsumer.controller;

import com.example.eurekaconsumer.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Date: 2021/2/19 10:57
 * @Author: yulei
 * @Description:
 */
@RestController
@RequestMapping("/Goods")
public class GoodsController {

    @Autowired
    private SysUserService sysUserService;

    /**
     * 商品详情*****
     * @param request
     * @return
     */
    @RequestMapping("/pro_info")
    public Map pro_info(HttpServletRequest request) {
        Map goodsInfo=sysUserService.proInfo(request.getParameter("goodsId").toString());
        return goodsInfo;
    }

    /**
     * 商品列表页面
     *
     * @param request
     * @param model
     * @return
     */
    @RequestMapping("/pro_list")
    public String pro_list(HttpServletRequest request, Model model) {
        //商品列表
//        List list=sysUserService.getList(request.get);
//        model.addAttribute("keywords",(request.getParameter("keywords"))==null?"":request.getParameter("keywords"));
//        model.addAttribute("title","列表");
//        model.addAttribute("goods",list);
        return "pro_list";
    }

}
